import axios from '../utils/request'


// 验证手机号码是否被注册过
export function docheckphone(data: { tel: string }) {
    return axios({
        url: '/user/docheckphone',
        data,
        method: 'POST'
    })
}

// 发送短信验证码
export function dosendmsgcode(data: { tel: string }) {
    return axios({
        url: '/user/dosendmsgcode',
        data,
        method: 'POST'
    })
}


// 验证短信验证码
export function docheckcode(data: { tel: string, telcode: string }) {
    return axios({
        url: '/user/docheckcode',
        data,
        method: 'POST'
    })
}



// 注册--设置密码
export function dofinishregister(data: { tel: string, password: string }) {
    return axios({
        url: '/user/dofinishregister',
        data,
        method: 'POST'
    })
}


// 账户名/手机号/邮箱 + 密码的登录方式
export function login(data: { loginname: string, password: string }) {
    return axios({
        url: '/user/login',
        data,
        method: 'POST'
    })
}